<?php

/**
 * Idea form.
 *
 * @package    ideas
 * @subpackage form
 * @author     AlvaroLara
 */
class IdeaForm extends BaseIdeaForm
{
  public function configure()
  {
    unset($this['created_at'],
          $this['updated_at'],
          $this['rank'],
          $this['idea_user_ranking_list'],
          $this['favourite_list'],
          $this['category_id']);

    sfContext::getInstance()->getConfiguration()->loadHelpers(array('I18N', 'Asset', 'Tag', 'Url'));

    $this->getWidget('idea_concept_list')->setOption('renderer_class','sfWidgetFormSelectDoubleList');
    $this->getWidget('idea_concept_list')->setOption('renderer_options',array(
                   'label_unassociated'=> __('Unassociated'),
                   'label_associated'  => __('Associated'),
                   'unassociate' => image_tag('/csPropelRevisitedGeneratorPlugin/images/icons/16x16/remove.png',array('alt'=> 'unassociate')),
                   'associate' => image_tag('/csPropelRevisitedGeneratorPlugin/images/icons/16x16/add.png',array('alt' => 'associate'))
    ));
    $this->setWidget('description', new sfWidgetFormTextareaTinyMCE(array(
                                    'width'  => 550,
                                    'height' => 350,
                                    'config' => 'theme_advanced_disable: "anchor,image,cleanup,help"',
    )));

    $this->getWidgetSchema()->setLabel('idea_concept_list','Related concepts');

    $this->setWidget('owner_id', new sfWidgetFormInputHidden());
    $this->setDefault('owner_id',sfContext::getInstance()->getUser()->getAppUser()->getId());

  }
}
